<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Important extends MY_Controller {

	function Important()
	{
		parent::MY_Controller();
		parent::check_user_login();
		$this->load->helper('page');
		page_common();
	}

	function view($orderid){
        $user = parent::get_session_value('user');
        if(!$user){
            parent::redirect('你无权查看该页面','back');
        }
        $utype = substr(strtoupper($user['username']),0,2);
        $this->load->model('Morders');
        $oinfo = $this->Morders->get_order_info($orderid);
        if($utype != 'WB' || $oinfo['dai_state'] == 8){
            parent::redirect('你无权查看该页面','back');
        }
		$this->load->model('Mimportant');
		$info = $this->Mimportant->get_important_by_orderid($orderid);
		$this->template->view('v1/important_view.tpl',array('info'=>$info));
	}

}

?>